﻿using IServices.ICurrency;
using IServices.IGoodsConfig;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading.Tasks;

namespace AikeApplets.Areas.Commodity.Controllers
{
    [Area("Commodity")]
    public class CommodityController : Controller
    {
        private readonly IGoodsCats _goods;
        private readonly ICurrencyServer _currencyServer;

        public CommodityController(IGoodsCats goods, ICurrencyServer currencyServer)
        {
            _goods = goods ?? throw new ArgumentNullException(nameof(goods));
            _currencyServer = currencyServer ?? throw new ArgumentNullException(nameof(currencyServer));
        }

        #region 试图
        public async Task<IActionResult> Index()
        {
            var data = await _goods.GetParentInfomationBySql();
            if (data.Rows.Count == 0) return null;
            return View(data);
        }
        #endregion
    }
}
